<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>时间轴</title>
    <link href="../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link href="../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
    <link href="../static/css/animate.min.css" th:href="@{/css/animate.min.css}" rel="stylesheet"/>
    <link href="../static/css/style.min.css" th:href="@{/css/style.min.css}" rel="stylesheet"/>
</head>
<body class="gray-bg">
<div class="row animated fadeInRight">
    <div class="ibox float-e-margins">
        <div class="text-center float-e-margins p-md">
            <a href="#" class="btn btn-xs btn-primary" id="lightVersion">轻型版本 </a>
            <a href="#" class="btn btn-xs btn-primary" id="darkVersion">黑色版本 </a>
            <a class="btn btn-xs btn-success" onclick="addTimeLineS()" shiro:hasPermission="timeline:s:add"> <i
                    class="fa fa-plus"></i> 新增
            </a>
        </div>
        <div id="ibox-content">
            <div id="vertical-timeline" class="vertical-container light-timeline">

                <!--展示时间轴-->
                <div th:each="item:${timelineSList}" class="vertical-timeline-block">
                    <div class="vertical-timeline-icon navy-bg">
                        <i class="fa fa-briefcase"></i>
                    </div>

                    <div class="vertical-timeline-content">
                        <a href="javascript:void(0)" th:onclick=$.operate.viewDetail("/memorial/TimeLineS/detail/"+[[${item.id}]],[[${item.timeTitle}]])><h2 th:text="${item.timeTitle}"/></a>
                        <p th:text="${item.summary}">上一年的销售业绩发布会。总结产品营销和销售趋势及销售的现状。
                        </p>
                        <a th:onclick="openTimeLineSDetail([[${item.id}]])" shiro:hasPermission="timeline:s:detail" class="btn btn-sm btn-primary"> 更多信息</a>
                        <a th:onclick="removeTimeLineS([[${item.id}]])" shiro:hasPermission="timeline:s:remove" class="btn btn-sm btn-danger">删除 </a>

<!--                        <span class="vertical-date">-->
<!--                         	今天 <br>-->
<!--                         发 布 人：<small th:text="${item.createBy}"></small> <br>-->
                         发布时间：<small th:text="${#dates.format(item.createTime,'yyyy-MM-dd HH:mm:ss')}">2月3日</small>
                     </span>
                    </div>
                </div>

                <!--                <div class="vertical-timeline-block">-->
                <!--                    <div class="vertical-timeline-icon blue-bg">-->
                <!--                        <i class="fa fa-file-text"></i>-->
                <!--                    </div>-->

                <!--                    <div class="vertical-timeline-content">-->
                <!--                        <h2>给张三发送文档</h2>-->
                <!--                        <p>发送上年度《销售业绩报告》</p>-->
                <!--                        <a href="#" class="btn btn-sm btn-success"> 下载文档 </a>-->
                <!--                        <span class="vertical-date">-->
                <!--                         	今天 <br>-->
                <!--                         <small>2月3日</small>-->
                <!--                     </span>-->
                <!--                    </div>-->
                <!--                </div>-->

                <!--                <div class="vertical-timeline-block">-->
                <!--                    <div class="vertical-timeline-icon lazur-bg">-->
                <!--                        <i class="fa fa-coffee"></i>-->
                <!--                    </div>-->

                <!--                    <div class="vertical-timeline-content">-->
                <!--                        <h2>喝咖啡休息</h2>-->
                <!--                        <p>喝咖啡啦，啦啦啦~~</p>-->
                <!--                        <a href="#" class="btn btn-sm btn-info">更多</a>-->
                <!--                        <span class="vertical-date"> 昨天 <br><small>2月2日</small></span>-->
                <!--                    </div>-->
                <!--                </div>-->

                <!--                <div class="vertical-timeline-block">-->
                <!--                    <div class="vertical-timeline-icon yellow-bg">-->
                <!--                        <i class="fa fa-phone"></i>-->
                <!--                    </div>-->

                <!--                    <div class="vertical-timeline-content">-->
                <!--                        <h2>给李四打电话</h2>-->
                <!--                        <p>给李四打电话分配本月工作任务</p>-->
                <!--                        <span class="vertical-date">昨天 <br><small>2月2日</small></span>-->
                <!--                    </div>-->
                <!--                </div>-->

                <!--                <div class="vertical-timeline-block">-->
                <!--                    <div class="vertical-timeline-icon lazur-bg">-->
                <!--                        <i class="fa fa-user-md"></i>-->
                <!--                    </div>-->

                <!--                    <div class="vertical-timeline-content">-->
                <!--                        <h2>公司年会</h2>-->
                <!--                        <p>发年终奖啦，啦啦啦~~</p>-->
                <!--                        <span class="vertical-date">前天 <br><small>2月1日</small></span>-->
                <!--                    </div>-->
                <!--                </div>-->
                <!--                -->
            </div>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    $(document).ready(function () {
        $('#lightVersion').click(function (event) {
            event.preventDefault()
            $('#ibox-content').removeClass('ibox-content');
            $('#vertical-timeline').removeClass('dark-timeline');
            $('#vertical-timeline').addClass('light-timeline');
        });
        $('#darkVersion').click(function (event) {
            event.preventDefault()
            $('#ibox-content').addClass('ibox-content');
            $('#vertical-timeline').removeClass('light-timeline');
            $('#vertical-timeline').addClass('dark-timeline');
        });
    });

    function addTimeLineS() {
        var mId = [[${mId}]]
        var url = '/memorial/TimeLineS/add/' + mId;
        $.modal.openFull("新增时间轴", url);
    }

    function openTimeLineSDetail(id) {
        debugger
        var url = '/memorial/TimeLineS/detail/' + id;
        $.modal.openTab("详情",url,true);
    }
    // function removeTimeLineS(id) {
    //     table.set();
    //     debugger
    //     $.modal.confirm("确定删除该条信息吗？", function() {
    //         var url = "/memorial/TimeLineS/remove";
    //         debugger
    //         var data = { "ids": id };
    //         $.operate.submit(url, "post", "json", data);
    //         // $.modal.msgSuccessReload();
    //         location.replace(location.href);
    //     });
    // }
    function removeTimeLineS(id) {
        table.set();
        debugger
        $.modal.confirm("确定删除该条信息吗？", function() {
            var url = "/memorial/TimeLineS/remove";
            debugger
            var data = { "ids": id };
            // $.operate.submit(url, "post", "json", data);
            $.ajax({
                type: "post",
                url: url,
                data: data,
                dataType: "json",
                success: function (data) {
                    console.log(data,"data");
                    location.replace(location.href);

                },
                error: function(xhr, textStatus) {
                    debugger
                    console.log(xhr);
                    console.log(textStatus);
                }
            });
        });
    }
</script>
</body>
</html>
